package org.particlethink.response;

import io.swagger.v3.oas.annotations.media.Schema;
import org.particlethink.model.PlanMaterial;
import org.particlethink.model.Supplier;

import java.util.Optional;

public class PlanMaterialResponse {
    @Schema(description = "材料")
    private MaterialResponse material;

    @Schema(description = "计划数量")
    private int expectNum;//计划数量
    @Schema(description = "已规划数量 仅总计划")
    private int actualNum;//已规划数量
    @Schema(description = "已入库数量")
    private int completeNum;//已入库数量

    @Schema(description = "供货商 仅订单物料")
    private SupplierResponse supplier;//供货商id
    @Schema(description = "使用部位")
    private String purpose;//使用部位
    @Schema(description = "备注")
    private String remark;
    private Integer id;


    public PlanMaterialResponse(PlanMaterial planMaterial, MaterialResponse material, Supplier supplier) {
        this.material = material;
        this.expectNum = planMaterial.getExpectNum();
        this.actualNum = planMaterial.getActualNum();
        this.completeNum = planMaterial.getCompleteNum();
        this.supplier = supplier == null ? null : new SupplierResponse(supplier);
        this.purpose = planMaterial.getPurpose();
        this.remark = planMaterial.getRemark();
        this.id = planMaterial.getId();
    }

    public PlanMaterialResponse() {
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public MaterialResponse getMaterial() {
        return material;
    }

    public void setMaterial(MaterialResponse material) {
        this.material = material;
    }

    public int getExpectNum() {
        return expectNum;
    }

    public void setExpectNum(int expectNum) {
        this.expectNum = expectNum;
    }

    public int getActualNum() {
        return actualNum;
    }

    public void setActualNum(int actualNum) {
        this.actualNum = actualNum;
    }

    public int getCompleteNum() {
        return completeNum;
    }

    public void setCompleteNum(int completeNum) {
        this.completeNum = completeNum;
    }

    public String getPurpose() {
        return purpose;
    }

    public void setPurpose(String purpose) {
        this.purpose = purpose;
    }

    public SupplierResponse getSupplier() {
        return supplier;
    }

    public void setSupplier(SupplierResponse supplier) {
        this.supplier = supplier;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }
}
